Always use gint for border_width
authorMatthias Clasen <mclasen@redhat.com>
Sat, 4 May 2013 23:21:56 +0000 (19:21 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 4 May 2013 23:21:56 +0000 (19:21 -0400)
This avoids an evil trap when doing MAX (..., ... - 2 * border_width)
and the expression on the right gets promoted to unsigned, instead
of going negative as you would expect.
https://bugzilla.gnome.org/show_bug.cgi?id=699633

gtk/gtkalignment.c
gtk/gtkframe.c
gtk/gtknotebook.c
gtk/gtkviewport.c
gtk/gtkwindow.c

index f85c90dc328c841b7178542c654ab53433e05846..bb5eb4a33118fa1de9237f07fa0e033675fa3556 100644 (file)
@@ -512,7 +512,7 @@ gtk_alignment_size_allocate (GtkWidget     *widget,
   GtkAllocation child_allocation;
   GtkWidget *child;
   gint width, height;
-  guint border_width;
+  gint border_width;
   gint padding_horizontal, padding_vertical;
   gint baseline;
 
index 9b81631394c455e6d3adefe903861ab7a14d012c..2e01d951e3039e5ced80ff249bfe7091e8dfb870 100644 (file)
@@ -816,7 +816,7 @@ gtk_frame_real_compute_child_allocation (GtkFrame      *frame,
   GtkAllocation allocation;
   GtkBorder padding;
   gint top_margin;
-  guint border_width;
+  gint border_width;
 
   gtk_widget_get_allocation (widget, &allocation);
   get_padding_and_border (frame, &padding);
index 3265f982e9b372dceae83dc4461e5834d45ea988..c446a267488dc2a291aef0bc37ecb816562a5ab4 100644 (file)
@@ -2459,7 +2459,7 @@ gtk_notebook_size_allocate (GtkWidget     *widget,
 
   if (priv->children)
     {
-      guint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+      gint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
       GtkNotebookPage *page;
       GtkAllocation child_allocation;
       GList *children;
index 0469c5bce43bc37809e29bdb281a7817f41503d6..145e7603ab49efcd68f0f63c4e3d56ea1f99aa01 100644 (file)
@@ -318,7 +318,7 @@ viewport_get_view_allocation (GtkViewport   *viewport,
   GtkStyleContext *context;
   GtkStateFlags state;
   GtkBorder padding, border;
-  guint border_width;
+  gint border_width;
 
   gtk_widget_get_allocation (widget, &allocation);
   border_width = gtk_container_get_border_width (GTK_CONTAINER (viewport));
index fcd2486735c8547e3b3ea66c78735c9e2fb04fd2..669b535fded46c2df5cbd8b5e73a198ae78276da 100644 (file)
@@ -6357,7 +6357,7 @@ _gtk_window_set_allocation (GtkWindow           *window,
   GtkWidget *widget = (GtkWidget *)window;
   GtkWindowPrivate *priv = window->priv;
   GtkAllocation child_allocation;
-  guint border_width;
+  gint border_width;
   GtkBorder window_border = { 0 };
   gint title_height = 0;